import 'package:fish_redux/fish_redux.dart';

import 'action.dart';
import 'state.dart';

Reducer<FixOrderViewState> buildReducer() {
  return asReducer(
    <Object, Reducer<FixOrderViewState>>{
      FixOrderViewAction.action: _onAction,
      FixOrderViewAction.onSetStep: _onSetStep,
    },
  );
}

FixOrderViewState _onAction(FixOrderViewState state, Action action) {
  final FixOrderViewState newState = state.clone();
  return newState;
}

FixOrderViewState _onSetStep(FixOrderViewState state, Action action) {
  final FixOrderViewState newState = state.clone()..step = action.payload;
  return newState;
}
